package com.yesjpt.dao;

import com.yesjpt.domain.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface UserDao {
    //查询所有
    @Select("select * from sys_user")
    List<User> findAll();

    @Select("select * from sys_user t where t.id = #{id}")
    User findById(@Param("id") String id);

    int update(User vo);
    //修改昵称
    int updateNickname(String id, String nickname);

    //删除用户
    @Delete("delete from sys_user t where t.id <> '0' and t.id = #{id}")
    Integer delete(@Param("id") String id);

    //添加
    @Insert("insert into sys_user(id, username, nickname, password) values(#{id}, #{username}, #{nickname}, #{password})")
    Integer add(User vo);

}

